package org.eweb4j.orm.config.bean;

import org.eweb4j.util.xml.tag.XmlTag;
import org.eweb4j.util.xml.tag.XmlTagType;

/**
 * ORM组件用来存取配置信息的bean
 * 
 * @author cfuture.aw
 * @since v1.a.0
 */
public class Property {
	/**
	 * POJO属性名字
	 */
	@XmlTag(type = XmlTagType.attriType)
	private String name;
	/**
	 * 数据类型
	 */
	@XmlTag(type = XmlTagType.attriType)
	private String type;
	/**
	 * 数据表字段名
	 */
	@XmlTag(type = XmlTagType.attriType)
	private String column;

	/**
	 * 关联哪个POJO
	 */
	@XmlTag(type = XmlTagType.attriType, canWrite = false)
	private String relBean;

	/**
	 * 关联POJO的哪个属性
	 */
	@XmlTag(type = XmlTagType.attriType, canWrite = false)
	private String relProperty;

	/**
	 * 关联哪个表（多对多用）
	 */
	@XmlTag(type = XmlTagType.attriType, canWrite = false)
	private String relTable;

	/**
	 * 从哪个字段（多对多用）
	 */
	@XmlTag(type = XmlTagType.attriType, canWrite = false)
	private String relFrom;

	/**
	 * 往哪个字段（多对多用）
	 */
	@XmlTag(type = XmlTagType.attriType, canWrite = false)
	private String relTo;
	@XmlTag(type = XmlTagType.attriType)
	private String pk;
	@XmlTag(type = XmlTagType.attriType, canWrite = false)
	private String notNull;
	@XmlTag(type = XmlTagType.attriType)
	private String autoIncrement;

	// @XmlTag(type = XmlTagType.attriType, value =
	// "org.eweb4j.orm.config.bean.Property", canWrite = true)
	// private String xmlBean;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getColumn() {
		return column;
	}

	public void setColumn(String column) {
		this.column = column;
	}

	public String getRelBean() {
		return relBean;
	}

	public void setRelBean(String relBean) {
		this.relBean = relBean;
	}

	public String getRelProperty() {
		return relProperty;
	}

	public void setRelProperty(String relProperty) {
		this.relProperty = relProperty;
	}

	public String getRelTable() {
		return relTable;
	}

	public void setRelTable(String relTable) {
		this.relTable = relTable;
	}

	public String getRelFrom() {
		return relFrom;
	}

	public void setRelFrom(String relFrom) {
		this.relFrom = relFrom;
	}

	public String getRelTo() {
		return relTo;
	}

	public void setRelTo(String relTo) {
		this.relTo = relTo;
	}

	public String getPk() {
		return pk;
	}

	public void setPk(String pk) {
		this.pk = pk;
	}

	public String getNotNull() {
		return notNull;
	}

	public void setNotNull(String notNull) {
		this.notNull = notNull;
	}

	public String getAutoIncrement() {
		return autoIncrement;
	}

	public void setAutoIncrement(String autoIncrement) {
		this.autoIncrement = autoIncrement;
	}

	@Override
	public String toString() {
		return "Property [name=" + name + ", type=" + type + ", column="
				+ column + ", pk=" + pk + ", autoIncrement=" + autoIncrement
				+ "]";
	}

	// public String getXmlBean() {
	// return xmlBean;
	// }
	//
	// public void setXmlBean(String xmlBean) {
	// this.xmlBean = xmlBean;
	// }

}
